import React,{Component} from 'react';

import {TextInput} from 'react-native';

export default class Demo09Component extends Component{
  constructor(){
    super();
    this.state = {
      myValue:'zhangsan'
    };
  }

  //msg对应的是 当前输入框中值
  handleChangeText=(msg)=>{
    //保存在状态中(状态的写操作)
    this.setState({myValue:msg});
  }

  render(){
    return <TextInput 
    onChangeText={this.handleChangeText}
    value={this.state.myValue}></TextInput>
  }
}